package com.example.demo2.service;

import com.example.demo2.bean.HomeBean;
import com.example.demo2.dao.HomeBeanDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class HomeBeanService {
    @Autowired
    HomeBeanDao dao;


    public List<HomeBean> list() {
        List<HomeBean> all= dao.findAll();
        return all;
    }

    public void deleteById(Integer home_id) {
        dao.deleteById(home_id);
    }

    public HomeBean update(HomeBean homeBean) {
        HomeBean save = dao.save(homeBean);
        return save;
    }

    public HomeBean addone(HomeBean homeBean) {
        HomeBean save = dao.save(homeBean);
        return save;
    }
}
